<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:directive.page language="java"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" />
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>信息发布编辑</title>
		<%@ include file="/commons/includes/head.jspf"%>
		<%@ include file="/commons/manage/content.jspf"%>
		<%@ include file="/commons/includes/kindeditor.jspf"%>
		<script type="text/javascript" src="informationEdit.js"></script>
	</head>
	<body>
		<form name="informationEdit" action="informationEdit.shtml"
			method="post">
			<input type="hidden" id="event" name="event" value="save" />
			<input type="hidden" name="ec_f_catalog" value="${form.catalog}"/>
			<input type="hidden" name="ec_f_state" value="${form.state}"/>
			<input type="hidden" name="editState" />
			<input type="hidden" name="photoIds" />
			<input type="hidden" name="id" value="${form.id}" />
			<input type="hidden" name="catalog" value="${form.catalog}" />
			<input type="hidden" name="publisher" value="${form.publisher}" />
			<input type="hidden" name="publishDate"
				value='<fmt:formatDate
								value="${form.publishDate}" pattern="yyyy-MM-dd HH:mm:ss" />' />
			<input type="hidden" name="creator" value="${form.creator}" />
			<input type="hidden" name="create"
				value='<fmt:formatDate
								value="${form.create}" pattern="yyyy-MM-dd HH:mm:ss" />' />
			<input type="hidden" name="state"
				value="${empty form.state?'DRAFT':form.state}" />
			<c:set var="isEdit" value="${not (form.state eq 'DEL')}" />
			<c:set var="isShow" value="${(form.catalog > 4) and  ((form.catalog != 25) and (form.catalog != 26))}" />
			<div class="contBtnDiv">
				<c:if test="${isShow}">
					<span class="contBtn contBtnBack" id="btnBack">返 回</span>
				</c:if>
				<c:if test="${isEdit}">
					<span class="contBtn contBtnSave" id="btnSave">保 存</span>
					<c:if test="${empty form.state or form.state eq 'DRAFT'}">
						<span class="contBtn contBtnPublish" id="btnPublish">发 布</span>
					</c:if>
					<span class="contBtn contBtnPreview" id="btnPreview">预 览</span>
					<c:if test="${form.id>0 and isShow}">
						<span class="contBtn contBtnNew" id="btnAdd">新 增</span>
						<span class="contBtn contBtnDel" id="btnDel">删 除</span>
					</c:if>
				</c:if>
				<c:if test="${(form.state eq 'DEL') and isShow}">
					<span class="contBtn contBtnDel" id="btnComplete">彻底删除</span>
					<span class="contBtn contBtnRestore" id="btnRestore">恢 复</span>
				</c:if>
			</div>

			<table class="editBlock">
				<tr>
					<td class="label">
						<font color="red" style="font-family: Tahoma; font-weight: bold;">*</font>&nbsp;标题
					</td>
					<td class="value2" colspan="3">
						<input type="text" class="text required" name="title"
							value="<c:out value="${form.title}" />" title="标题" ${isEdit?'': 'readonly=readonly'}/>
					</td>
				</tr>
				<tr>
					<td class="label">
						来源
					</td>
					<td class="value2" colspan="3">
						<input type="text" class="text" name="source"
							value="<c:out value="${form.source}" />" title="来源" ${isEdit?'': 'readonly=readonly'}/>
					</td>
				</tr>
				<tr>
					<td class="label">
						简介
					</td>
					<td class="value2" colspan="3">
						<textarea ${isEdit?'': 'readonly=readonly '} rows="5" title="简介"
							name="describe" style="width: 657px; overflow: auto;">${form.describe}</textarea>
					</td>
				</tr>
				<tr>
					<td class="label">
						置顶显示
					</td>
					<td class="value4">
						<input id="stFalse" type="radio"  name="sticky" value="false"
							<c:if test="${not form.sticky}">checked="checked"</c:if>  ${isEdit?'': 'disabled=disabled'}/>
						<label for="stFalse">
							否
						</label>
						<input id="stTrue" type="radio" name="sticky" value="true"
							<c:if test="${form.sticky}">checked="checked"</c:if> ${isEdit?'': 'disabled=disabled'}/>
						<label for="stTrue">
							是
						</label>
					</td>
					<td class="label">
						显示发布时间
					</td>
					<td class="value4">
						<input id="spdFalse" type="radio"  name="showPubDate" value="false"
							<c:if test="${not form.showPubDate}">checked="checked"</c:if>  ${isEdit?'': 'disabled=disabled'}/>
						<label for="spdFalse">
							否
						</label>
						<input id="spdTrue" type="radio" name="showPubDate" value="true"
							<c:if test="${form.showPubDate}">checked="checked"</c:if> ${isEdit?'': 'disabled=disabled'}/>
						<label for="spdTrue">
							是
						</label>
					</td>
				</tr>
				<c:if test="${isEdit}">
					<tr>
						<td class="label">
							首页图片
						</td>
						<td class="value2" colspan="3">
							<select id="photoList" multiple="multiple" style="width: 200px; height: 100px; border: 1px solid;">
								<option>空</option>
								<c:forEach items="${attachmentList}" var="attachment">
									<c:set var="photoUrl" value="${attachment.link}${attachment.id}"/>
									<option value="<c:url value = "${photoUrl}" />" ${photoUrl == form.display?'selected=selected' : ''}>
										<c:out value="${(empty attachment.title)?(attachment.name):(attachment.title)}" />
									</option>
								</c:forEach>
							</select>
							<img id="showPhoto" height="110" src="<c:url value = "${form.display}" />" width="110" border="0" />
							<input type="hidden" name="display" value="${form.display}"/>
							<button class="btnL" id="btnSetIndexShow">设为首页图片</button>
						</td>
					</tr>
				</c:if>
				<c:if test="${!isEdit}">
					<tr>
						<td class="label">
							信息内容
						</td>
						<td class="value2" colspan="3">
							<div style="border:#999999 solid 1px;">
								${form.content}
							</div>
						</td>
					</tr>
				</c:if>
			</table>
			<c:if test="${isEdit}">
				<div class="editor">
					<textarea id="content1" name="content" title="新闻内容" class="required" rows="10">${form.content}</textarea>
				</div>
			</c:if>
		</form>
	</body>
</html>